#!/usr/bin/env python

import LocalMr

def mapper(key,value):
    fields=value.strip().split()
    for field in fields:
        yield field,1
reducer=lambda key,values:(key,sum(values))

LocalMr.mapper=mapper
LocalMr.reducer=reducer

if __name__ == '__main__':
    for row in LocalMr.run('*.py'):
        print row
